package com.yunao.web.convert;


import com.yunao.entity.Subject;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

public class Subject2QueryMap {

    public static Map<String,String> subject2map(Subject subject, Map<String,String> map){
        if (StringUtils.isEmpty(subject.getRemoveWord()))
            map.put("keywords",subject.getWord());
        else
            map.put("keywords",subject.getWord()+"-"+subject.getRemoveWord());
        if (StringUtils.isNotEmpty(subject.getSubjectLocaltion()))
             map.put("location",subject.getSubjectLocaltion());
        return map;
    }
}
